package models

// 抽奖活动
type MaLotteryActivity struct {
	ID   string `gorm:"primaryKey;column:id;autoIncrement;type:bigint unsigned;not null;comment:唯一ID" json:"id" json_old:"ID"`
	Name string `gorm:"column:name;type:varchar(60);not null;comment:活动名称" json:"name"`

	ThemesColor string `gorm:"column:themes_color;type:varchar(128);comment:主题背景" json:"themes_color"`

	ThemesImage string `gorm:"column:themes_image;type:varchar(128);comment:自定义图片" json:"themes_image"`

	OrderAmountRequired int     `gorm:"column:order_amount_required;type:tinyint(1);default:2;not null;comment:消费金额:1消费限额2消费不限额 " json:"order_amount_required"`
	OrderAmount         float64 `gorm:"column:order_amount;type:decimal(10,2);default:0.00;not null;comment:消费金额" json:"order_amount"`
	StartTime           int     `gorm:"column:start_time;type:varchar(30);not null;comment:开始时间" json:"start_time"`
	EndTime             int     `gorm:"column:end_time;type:varchar(30);not null;comment:结束时间" json:"end_time"`
	Status              int     `gorm:"column:status;type:tinyint(1);default:1;comment: 活动状态：1启动 2禁用" json:"status"`
	ActivityStatus      int     `gorm:"-" json:"activity_status"`
	AllowRobots         string  `gorm:"-" json:"allow_robots"`
	AllowLocationID     string  `gorm:"-" json:"allow_location_id"`
	Type                int     `gorm:"column:type;type:tinyint(1);default:1;comment: 活动类型：1兑换码 2扭蛋机" json:"type"`
	Desc                string  `gorm:"column:desc;type:text;not null;comment:活动描述" json:"desc"`
	TotalWinTimes       int     `gorm:"column:total_win_times;type:int;size:64;default:-1;not null;comment:允许当前活动一个人最大中奖次数" json:"total_win_times"`
	DailyWinTimes       int     `gorm:"column:daily_win_times;type:int;size:64;default:-1;not null;comment:允许（单日）一个人最大中奖次数" json:"daily_win_times"`
	TotalLotteryTimes   int     `gorm:"column:total_lottery_times;type:int;size:64;default:-1;not null;comment:最大抽奖次数" json:"total_lottery_times"`
	DaliyLotteryTimes   int     `gorm:"column:daliy_lottery_times;type:int;size:64;default:-1;not null;comment:单日最大抽奖次数" json:"daliy_lottery_times"`
	WechatImg           string  `gorm:"column:wechat_img;type:varchar(200);comment:微信客户二维码地址" json:"wechat_img"`
	ServicePhone        string  `gorm:"column:service_phone;type:varchar(20);comment:服务电话" json:"service_phone"`
	AllowCitys          string  `gorm:"column:allow_citys;type:text;comment:参与地区" json:"allow_citys"`

	// 从锦鲤活动奖项规则迁移过来的
	RedemptionStartTime int    `gorm:"column:redemption_start_time;type:varchar(20);comment:固定日期开始时间" json:"redemption_start_time"`
	RedemptionEndTime   int    `gorm:"column:redemption_end_time;type:varchar(20);comment:固定日期结束时间" json:"redemption_end_time"`
	RedemptionStartWeek string `gorm:"column:redemption_start_week;type:varchar(20);comment:固定时长，比如周一、周二" json:"redemption_start_week"`

	CreatedAt int64 `gorm:"column:created_at;autoCreateTime;type:int;size:64;comment:创建时间" json:"created_at"`
	UpdatedAt int64 `gorm:"column:updated_at;autoUpdateTime;type:int;size:64;comment:修改时间" json:"updated_at"`
	DeletedAt int64 `gorm:"column:deleted_at;type:int;size:64;default:0;comment:删除时间" json:"deleted_at"`
}

func (m MaLotteryActivity) TableName() string {
	return "ma_lottery_activity"
}
